#include <myheader_c_plus.h>
using std::endl;
using std::cout;
using std::list;
template<typename Container>
void display(Container & con){
    for(auto & it : con){
        cout << it << " ";
    }
    cout << endl;
}
void test(){
    list<int> li = {10,11,9,5};
    list<int> li2 = {32,43,12,53};
    li.merge(li2);
    li.sort();
    for(auto & ele : li){
        cout << ele << " ";
    }
    cout << endl;

}

void test_splice(){
    list<int> li = {10,11,9,5};
    list<int> li2 = {32,43,12,53,67,45};
    auto it = li.begin();
    ++it;
    // li.splice(it, li2);
    // display(li);
    // cout << "===" << endl;
    // display(li2);
    auto cit = li2.begin();
    ++cit;
    auto cit2 = li2.end();
    --cit2;
    --cit2;
    li.splice(it, li2, cit, cit2);
    display(li);

}
int main(int argc, char *argv[])
{
    test_splice();
    return 0;
}

